package md.lanjing.com.module_deal_center.contact;

import android.content.Context;

import com.lxh.baselibray.mvp.BasePresent;
import com.lxh.baselibray.mvp.IBaseView;
import com.lxh.baselibray.net.NetCallBack;
import com.lxh.baselibray.net.ServiceGenerator;
import com.lxh.baselibray.util.ToastUtils;

;
import md.lanjing.com.module_deal_center.api.DealApiService;
import md.lanjing.com.module_deal_center.bean.PayMoneyDetailRequest;
import md.lanjing.com.module_deal_center.bean.PayMoneyDetailResponce;
import retrofit2.Call;
import retrofit2.Response;

public class PayMoneyDetailContact {
    public static class PayMoneyDetailPresent extends BasePresent<IPayMoneyDetailView> {
        public void queryPayMoneyMsg(final Context context, String billId, String type){
            DealApiService service= ServiceGenerator.createService(DealApiService.class);
            PayMoneyDetailRequest request=new PayMoneyDetailRequest(billId,type);
            service.payMoneyDetail(request).enqueue(new NetCallBack<PayMoneyDetailResponce>() {
                @Override
                public void onSuccess(Call<PayMoneyDetailResponce> call, Response<PayMoneyDetailResponce> response) {
                    if (getView()!=null){
                        getView().getPayMoneyDetailMsgData( response);
                    }
                }

                @Override
                public void onFailed() {
                    ToastUtils.showLongToast(context,"网络请求异常");
                }
            });
        }
    }
    public interface IPayMoneyDetailView extends IBaseView {
        void getPayMoneyDetailMsgData(Response<PayMoneyDetailResponce> response);
    }
}
